1 From 8928756d53d5b99dcd18073dc7738b8ebdbe7d96 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Thu, 2 May 2024 10:44:42 +0200
4 Subject: [PATCH 1/6] net: move skb_gro_receive_list from udp to core
6 This helper function will be used for TCP fraglist GRO support
8 Acked-by: Paolo Abeni <pabeni@redhat.com>
9 Reviewed-by: Eric Dumazet <edumazet@google.com>
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 Reviewed-by: David Ahern <dsahern@kernel.org>
12 Reviewed-by: Willem de Bruijn <willemb@google.com>
13 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
15 include/net/gro.h | 1 +
16 net/core/gro.c | 27 +++++++++++++++++++++++++++
17 net/ipv4/udp_offload.c | 27 ---------------------------
18 3 files changed, 28 insertions(+), 27 deletions(-)
20 --- a/include/net/gro.h
21 +++ b/include/net/gro.h
22 @@ -439,6 +439,7 @@ static inline __wsum ip6_gro_compute_pse
25 int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb);
26 +int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb);
28 /* Pass the currently batched GRO_NORMAL SKBs up to the stack. */
29 static inline void gro_normal_list(struct napi_struct *napi)
32 @@ -228,6 +228,33 @@ done:
36 +int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
38 + if (unlikely(p->len + skb->len >= 65536))
41 + if (NAPI_GRO_CB(p)->last == p)
42 + skb_shinfo(p)->frag_list = skb;
44 + NAPI_GRO_CB(p)->last->next = skb;
46 + skb_pull(skb, skb_gro_offset(skb));
48 + NAPI_GRO_CB(p)->last = skb;
49 + NAPI_GRO_CB(p)->count++;
50 + p->data_len += skb->len;
52 + /* sk ownership - if any - completely transferred to the aggregated packet */
53 + skb->destructor = NULL;
55 + p->truesize += skb->truesize;
58 + NAPI_GRO_CB(skb)->same_flow = 1;
64 static void napi_gro_complete(struct napi_struct *napi, struct sk_buff *skb)
66 --- a/net/ipv4/udp_offload.c
67 +++ b/net/ipv4/udp_offload.c
68 @@ -474,33 +474,6 @@ out:
72 -static int skb_gro_receive_list(struct sk_buff *p, struct sk_buff *skb)
74 - if (unlikely(p->len + skb->len >= 65536))
77 - if (NAPI_GRO_CB(p)->last == p)
78 - skb_shinfo(p)->frag_list = skb;
80 - NAPI_GRO_CB(p)->last->next = skb;
82 - skb_pull(skb, skb_gro_offset(skb));
84 - NAPI_GRO_CB(p)->last = skb;
85 - NAPI_GRO_CB(p)->count++;
86 - p->data_len += skb->len;
88 - /* sk ownership - if any - completely transferred to the aggregated packet */
89 - skb->destructor = NULL;
91 - p->truesize += skb->truesize;
94 - NAPI_GRO_CB(skb)->same_flow = 1;
100 #define UDP_GRO_CNT_MAX 64
101 static struct sk_buff *udp_gro_receive_segment(struct list_head *head,